﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WiTeach.Tools;

namespace WiTeach.ClassManagement.DAL
{
    public class FileDAL
    {
        private static string tableName = "ta_lesson_material";

        /// <summary>
        /// 通过课时ID 获取ppt 文件名称
        /// </summary>
        /// <param name="classHourID"></param>
        /// <returns></returns>
       public static string getPPTUrlByClassHourID(int classHourID)
       {
           string sql = "select PPTName from "+tableName+" where ClassHour_ID = "+classHourID;
           return (string)SqlHelper.ExecuteScalar(sql);
       }

       /// <summary>
       /// 通过课时ID 获取ppt 文件名称
       /// </summary>
       /// <param name="classHourID"></param>
       /// <returns></returns>
       public static string getPDFUrlByClassHourID(int classHourID)
       {
           string sql = "select PDFName from " + tableName + " where ClassHour_ID = " + classHourID;
           return (string)SqlHelper.ExecuteScalar(sql);
       }

       /// <summary>
       /// 通过课时ID 获取ppt 文件名称
       /// </summary>
       /// <param name="classHourID"></param>
       /// <returns></returns>
       public static string getVideoUrlByClassHourID(int classHourID)
       {
           string sql = "select VideoName from " + tableName + " where ID = " + classHourID;
           return (string)SqlHelper.ExecuteScalar(sql);
       }
    }
}
